<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
  </style>
</head>
<body>
  <script>
    var number = Math.random() * 100 ;

    number = Math.floor(number) ;

    console.log(number)

    for (var i = 0; i<7; i++)
    {
      var n = prompt("请输入数",n) ;

      if(n>number) alert("数大了")

      else if(n < number) alert("数小了")

      else {
        alert("牛逼")

        break;
      }
    }
  </script>
</body>
</html>